/*
-----------------------------------------------------------------------------
Filename:    Ship.h
-----------------------------------------------------------------------------
*/
#ifndef __Ship_h_
#define __Ship_h_

#include <OGRE/Ogre.h>

#include "BaseApplication.h"

// Collision System
#include "CollisionTools.h"

// OpenAL sound
#include "SoundManager.h"

class Ship
{
public:

	// Constructor
	Ship(Ogre::SceneManager* sceneMgr, MOC::CollisionTools* mCollisionTools, SoundManager* soundM, int index);

	// move the ship
	void moveShip(const Ogre::FrameEvent& evt);
	
	//ship names
	Ogre::String strShipNode;
		
	// ship variables
	int indexTipoNave;
	Ogre::SceneNode* shipNode;
	Ogre::Entity* shipEntity;
	
	Ogre::Vector3 shipDirection;
	Ogre::Real shipSpeed, maxSpeed;

	bool acelerate, decelerate;
	Ogre::Real shipRotY, speedRot;

	bool inGoal;
	
	// points
	float mPoints;

	// camera
	Ogre::SceneNode* mCameraNode;
	void changeCamera(int n);

	
	// Animation system
	Ogre::AnimationState *anim_idle, *anim_misil, *anim_ajuste, *anim_aterrizar;
	bool control_idle, control_misil, control_ajuste, control_aterrizar,control_despegar;
	void processAnimations(const Ogre::FrameEvent& evt);

	// particles
	Ogre::ParticleSystem *motorParticles, *ledParticleL, *ledParticleR, *shootParticlesL, *shootParticlesR, *shootBoomParticle;	
	// Shoot functions
	void fireIons(bool activate);
	void fireFlames(bool activate);

private:
	void loadModel(int i);
	void setupParticles(int i);
	void setupSound(void);
	void setupCamera(void);

	Ogre::SceneManager* mSceneMgr;
	MOC::CollisionTools* mMOC;

	// Sound system
	SoundManager* mSoundMgr;
	unsigned int shootSound , flameSound, acelerateSound, ambientMusic;


};

#endif 
